import request from '@/utils/request'

// 获取列表
export function getAttendances(params) {
  return request({
    url: '/attendances',
    params
  })
}

// 获取出勤列表
export function getChuqin(data) {
  return request({
    url: '/cfg/atte/item',
    method: 'post',
    data
  })
}

// 设置出勤
export function settingChuqin(data) {
  return request({
    url: '/cfg/atte',
    method: 'put',
    data
  })
}

// 获取请假
export function getQingjia(data) {
  return request({
    url: '/cfg/leave/list',
    method: 'POST',
    data
  })
}

// 设置请假
export function gettingQingjia(data) {
  return request({
    url: '/cfg/leave',
    method: 'put',
    data
  })
}

// 获取扣款
export function getKoukuan(data) {
  return request({
    url: '/cfg/ded/list',
    method: 'POST',
    data
  })
}

// 设置扣款
export function settingKoukuan(data) {
  return request({
    url: '/cfg/deduction',
    method: 'put',
    data
  })
}

// 获取加班规则
export function getJiaban(data) {
  return request({
    url: '/cfg/extDuty/item',
    method: 'POST',
    data
  })
}

// 设置扣款
export function settingJiaban(data) {
  return request({
    url: '/cfg/extDuty',
    method: 'put',
    data
  })
}

// 设置员工考勤状态
export function settingAtteStatus(data) {
  return request({
    url: '/attendances/' + data.userId,
    method: 'put',
    data
  })
}

// 设置员工考勤状态
export function importAttendance(data) {
  return request({
    url: '/attendances/import',
    method: 'post',
    data
  })
}

// 获取月考勤报表数据
export function getReport(params) {
  return request({
    url: '/attendances/reports/',
    params
  })
}

// 月度考勤记录归档
export function setArchives(params) {
  return request({
    url: '/attendances/archives',
    params
  })
}

// 新建考勤报表
export function setNewArchives(params) {
  return request({
    url: '/attendances/newReports',
    params
  })
}

// 历史归档列表
export function gethistoryList(params) {
  return request({
    url: '/attendances/reports/year',
    params
  })
}

// 历史归档详情
export function gethistoryReports(id) {
  return request({
    url: '/attendances/reports/' + id
  })
}
